﻿using System;

namespace Orz.Framework.Core
{
    /// <summary>
    /// Delegate invoker.
    /// </summary>
    public class DelegateInvoker
    {
        /// <summary>
        /// Invokes the specified handler.
        /// </summary>
        /// <param name="handler">The handler.</param>
        /// <param name="args">The args.</param>
        public static void Invoke(Delegate handler, params object[] args)
        {
            Delegate temp = handler;
            if (temp != null)
                temp.DynamicInvoke(args);
        }
    }
}
